Skip to content

Use template "Check Shell" workflow (Task) #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 30, 2021
Merged

Use template "Check Shell" workflow (Task) #214

merged 8 commits into from
Jul 30, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jul 28, 2021

Source:
https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-shell-task.md


Note: the "ShellCheck" CI job failure is expected and results from a pre-existing issue in the installation script. I will fix that in a subsequent PR when I sync the installation script from the template one.

@per1234 per1234 added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels Jul 28, 2021
@codecov-commenter
Copy link

codecov-commenter commented Jul 28, 2021

Codecov Report

Merging #214 (3e63853) into main (2670f2a) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #214   +/-   ##
=======================================
  Coverage   87.97%   87.97%           
=======================================
  Files          43       43           
  Lines        4176     4176           
=======================================
  Hits         3674     3674           
  Misses        391      391           
  Partials      111      111           
Flag Coverage Δ
unit 87.97% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2670f2a...3e63853. Read the comment docs.

per1234 added 8 commits July 29, 2021 02:50
The preferred approach is for the tasks to install their specific dependencies as needed, in a manner that does not
pollute the task user's environment. However, it doesn't appear to be feasible to do this with the shfmt and ShellCheck
tools used by the `shell:format` task, so the task user is responsible for installing this tool.

In the event the task user does not have such a tool installed (or installation not in PATH), the task should provide a
helpful error message, which is provided by this change.
This is the standardized shell script formatting style to be used in all Arduino Tooling projects, as defined in
`/.editorconfig`.
- Use standardized task name
- Add support for arbitrary file extensions and path configurations (which is not possible with the previous globstar
  approach)
GitHub Actions provides a paths filter feature that allows you to restrict workflow run triggers to changes to specific
paths within the repository. This can greatly improve the efficiency of the CI system by avoiding running irrelevant
checks. The effective use of this feature requires that the purpose of a workflow be focused on a specific type of file
or project component. Since collecting related jobs into a single workflow can be the best approach both from a
maintainer and contributor viewpoint, it makes sense to do this grouping based on component type rather than on category
of operation, as was previously done by the "Check formatting" workflow.

The "Check Shell" workflow is collects the linting and formatting checks specific to the project's Shell script files.
Since Windows doesn't have the concept of an executable file mode, and shell scripts not considered executable by Linux,
etc. will work fine if a shell is installed (e.g., Git Bash), shell scripts written or worked on by Windows developers
may not be executable. For this reason, it is especially helpful for the CI to do a check on the file mode of the
project's shell scripts, failing if they are not executable.
The `shell:check-formatting` task has no value to the developer, since they will be better off to just run the formatting
task. The CI also doesn't make use of this task, instead taking the superior approach of running the formatting task and
then checking for a diff. Since there is no use for this task, it should be removed.
@per1234 per1234 merged commit 42a40f3 into arduino:main Jul 30, 2021
@per1234 per1234 deleted the check-shell branch July 30, 2021 13:06
@per1234 per1234 self-assigned this Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants